<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let money = 0
    while(true){
      let ts=+prompt(`
      请输入你的操作
      1.取款
      2.存款
      3.查看余额
      4.退出
      `)
      if(ts === 4){
        break
      }
      switch(ts){
        case 1:
          let qk = +prompt('取多少')
          if (money <= 0) {
            alert('没钱破产了')
            break
          } else if (money < qk) {
            alert(`余额不足，只能取${money}`)
            break
          } else if (qk % 100 !== 0) {
             alert('只能取整百数')
             break
          }
          money -= qk
          alert(`余额还剩余${money}`)
          break
        case 2:
          let ck = +prompt('请输入存款')
          if(ck % 100 !== 0){
            alert('只能存整百')
            break
          }
          money+=ck
          alert(`存款为${money}`)
          break
        case 3:
        alert(`存款为${money}`)
          break
        default:
          alert('破产了')
          break
      }

    }
  </script>
</body>
</html>